package com.csun.cmny.provider.service.impl;

import com.csun.cmny.core.support.BaseService;
import com.csun.cmny.provider.model.domain.OmcOldOutSetMealItem;
import com.csun.cmny.provider.service.OmcOldOutSetMealItemService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-09-29 09:39
 * @Description: the class omc old out set meal item service impl
 */
@Service
@Transactional
public class OmcOldOutSetMealItemServiceImpl extends BaseService<OmcOldOutSetMealItem>
        implements OmcOldOutSetMealItemService {

    /**
     * batch save with old out set meal id
     *
     * @param omcOldOutSetMealItemList the omc old out set meal item list
     * @param id                       the old out set meal id
     * @return the int.
     */
    @Override
    public Integer batchSaveWithSetMealId(List<OmcOldOutSetMealItem> omcOldOutSetMealItemList, Long id) {

        for (OmcOldOutSetMealItem item : omcOldOutSetMealItemList) {
            item.setOldOutSetMealId(id);
        }

        return batchSave(omcOldOutSetMealItemList);
    }
}
